package cn.uce.common.omg.service;

import cn.uce.base.entity.CsCustomerInformation;
import cn.uce.base.vo.CsCustomerInformationVo;
import cn.uce.common.omg.dao.impl.ICcCustomerInformationDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("ccCustomerInformationService")
public class CcCustomerInformationService {

    @Resource
    ICcCustomerInformationDao ccCustomerInformationDao;
    /***
     * 根据客户手机号查询客户信息。
     * @param phone
     * @return List<Map<String, Object>>
     */
    public CsCustomerInformationVo getCustomerInformationQueryPhone(String phone) {
        return ccCustomerInformationDao.getCustomerInformationQueryPhone(phone);
    }

    public List<CsCustomerInformationVo> getList(CsCustomerInformationVo csCustomerInformationVoPhone) {
        csCustomerInformationVoPhone.setDeleteFlag(0);
        return ccCustomerInformationDao.getList(csCustomerInformationVoPhone);
    }

    public int add(CsCustomerInformation entity) {
        return ccCustomerInformationDao.insert(entity);
    }

    public int upd(CsCustomerInformation entity) {
        return  ccCustomerInformationDao.updateById(entity);
    }

    public String getMaxCode() {
        return  ccCustomerInformationDao.getMaxCode();
    }
}
